//
//  CHUrlCode.swift
//  jyzx
//
//  Created by cyptt on 2022/5/19.
//

import UIKit

public class CHUrlCode: NSObject {

    
    public static func urlencode(_ string: String) -> String {
        let mstring = string.replacingOccurrences(of: " ", with: "+")
        let set = CharacterSet(charactersIn: "!*'\"();:@&=+$,/?%#[]% ")
        return mstring.addingPercentEncoding(withAllowedCharacters: set) ?? ""
    }

    
    public  static func urlDecode(_ string: String) -> String {
        
        return string.removingPercentEncoding ?? ""
    }

  
}
